from playwright.async_api import BrowserContext


# 登录gitee
async def login_gitee(browser: BrowserContext):
    print('开始登录 gitee')
    page = await browser.new_page()
    await page.goto("https://gitee.com")
    await page.wait_for_timeout(2000)
    # 页面交互
    # await page.get_by_role("link", name="登录").click()
    # await page.wait_for_timeout(5000)
    # await page.get_by_placeholder("手机／邮箱／个人空间地址").click()
    #
    # await page.get_by_placeholder("手机／邮箱／个人空间地址").fill("13711208663")
    # await page.wait_for_timeout(5000)
    # await page.get_by_placeholder("请输入密码").click()
    # await page.get_by_placeholder("请输入密码").fill("Rimuru@980909")
    # await page.wait_for_timeout(5000)
    # await page.locator("form").filter(has_text="记住我 短信验证登录 登 录 已有帐号，忘记密码？").locator("label").click()
    # await page.get_by_role("button", name="登 录").click()
    # await page.wait_for_timeout(5000)
    print('gitee 登录成功')
